<%-- 
    Document   : ketquatimkiemlichsugiaodichcontent
    Created on : Oct 30, 2011, 5:53:51 PM
    Author     : phathuynh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@page import="java.text.DecimalFormat"%>
<%@page import="hibernate.pojo.Sanpham"%>
<%@page import="hibernate.pojo.Dondathang"%>
<%@page import="hibernate.pojo.Chitietdondathang"%>
<%@page import="java.util.List"%>
<%@page import="hibernate.pojo.Khachhang"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Zing Deal | Thông tin khách hàng | Phiếu giao hàng</title>
        <link href="DealZing_files/6aad5646.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="DealZing_files/67c1986d.css" />
    </head>
    <%
        try {
            DecimalFormat df = new DecimalFormat("###,###");
            Khachhang khachHang = (Khachhang) session.getAttribute("KhachHang");
            List<Chitietdondathang> lstLichSuGiaoDich = (List<Chitietdondathang>) request.getAttribute("SearchTransactionResult");

    %> 
    <body>
        <div id="subContent">
            <div id="subMainContent1">
                <div id="static">
                    <div class="StaticTopPanel">
                        <h2 class="TitleMain">Các giao dịch</h2>                                     
                    </div>
                    <!-- End .StaticTopPanel -->

                    <div class="OuterContent">
                        <div class="InnerContent">
                            <div class="StaticMain">
                                <ul id="tabHeader">
                                    <li><a href="listdealboughtcontroller?action=listdealbought" title="Phiếu mua hàng"><span>Phiếu mua hàng</span></a></li>
                                    <li><a href="listdealboughtcontroller?action=listdealdelivery" title="Phiếu giao hàng"><span>Phiếu giao hàng</span></a></li>
                                    <li class="Active"><a href="listdealboughtcontroller?action=listdealtransactions" title="Lịch sử giao dịch"><span>Lịch sử giao dịch</span></a></li>
                                </ul>

                                <div class="ContentBlock">
                                    <form class="frmNapThe frmQLDH2" id="ZingTransactionIndexForm" method="post" action="http://deal.zing.vn/tp-ho-chi-minh/zing_transactions"><fieldset style="display:none;"><input type="hidden" name="_method" value="POST" /><input type="hidden" name="data[_Token][key]" value="9377ac733e255ab705e10fac0e866a374553cc9a" id="Token1645773629" /></fieldset>                    		
                                        <fieldset>
                                            <ul>
                                                <li>
                                                    <p>
                                                        <label class="RegLS">Tìm kiếm</label>
                                                    </p>
                                                    <ul class="Radio">
                                                        <li>
                                                            <input type="radio" class="No-border" id="opt-day" value="day" name="rediosearchtmp" />
                                                            Hôm nay 
                                                        </li>
                                                        <li>
                                                            <input type="radio" class="No-border" id="opt-week" value="week" name="rediosearchtmp" />
                                                            Tuần này 
                                                        </li>
                                                        <li>
                                                            <input type="radio" class="No-border" id="opt-month" value="month" name="rediosearchtmp" />
                                                            Tháng này 
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li>
                                                    <p>
                                                        <label class="RegLS">&nbsp;</label>
                                                    </p>
                                                    <ul class="Radio">
                                                        <li>
                                                            <input type="radio" class="No-border" id="opt-all" checked="checked" value="all" name="rediosearchtmp" />
                                                            Tất cả 
                                                        </li>
                                                        <li>
                                                            <label class="Reg-date">Từ</label>
                                                            <input type="text" name="form_date_text" class="date JsDateTime" />
                                                            <div class="JsDateTimeHide hide"><select name="data[ZingTransaction][from_date][day]" id="ZingTransactionFromDateDay">
                                                                    <option value="01">1</option>
                                                                    <option value="02">2</option>
                                                                    <option value="03">3</option>
                                                                    <option value="04">4</option>
                                                                    <option value="05">5</option>
                                                                    <option value="06" selected="selected">6</option>
                                                                    <option value="07">7</option>
                                                                    <option value="08">8</option>
                                                                    <option value="09">9</option>
                                                                    <option value="10">10</option>
                                                                    <option value="11">11</option>
                                                                    <option value="12">12</option>
                                                                    <option value="13">13</option>
                                                                    <option value="14">14</option>
                                                                    <option value="15">15</option>
                                                                    <option value="16">16</option>
                                                                    <option value="17">17</option>
                                                                    <option value="18">18</option>
                                                                    <option value="19">19</option>
                                                                    <option value="20">20</option>
                                                                    <option value="21">21</option>
                                                                    <option value="22">22</option>
                                                                    <option value="23">23</option>
                                                                    <option value="24">24</option>
                                                                    <option value="25">25</option>
                                                                    <option value="26">26</option>
                                                                    <option value="27">27</option>
                                                                    <option value="28">28</option>
                                                                    <option value="29">29</option>
                                                                    <option value="30">30</option>
                                                                    <option value="31">31</option>
                                                                </select>-<select name="data[ZingTransaction][from_date][month]" id="ZingTransactionFromDateMonth">
                                                                    <option value="01">01</option>
                                                                    <option value="02">02</option>
                                                                    <option value="03">03</option>
                                                                    <option value="04">04</option>
                                                                    <option value="05">05</option>
                                                                    <option value="06">06</option>
                                                                    <option value="07" selected="selected">07</option>
                                                                    <option value="08">08</option>
                                                                    <option value="09">09</option>
                                                                    <option value="10">10</option>
                                                                    <option value="11">11</option>
                                                                    <option value="12">12</option>
                                                                </select>-<select name="data[ZingTransaction][from_date][year]" id="ZingTransactionFromDateYear">
                                                                    <option value="2010">2010</option>
                                                                    <option value="2011" selected="selected">2011</option>
                                                                </select></div>                              					</li>
                                                        <li>
                                                            <label for="denngay" class="Reg-date">Đến</label>
                                                            <input type="text" name="to_date_text" class="date JsDateTime" />
                                                            <div class="JsDateTimeHide hide"><select name="data[ZingTransaction][to_date][day]" id="ZingTransactionToDateDay">
                                                                    <option value="01">1</option>
                                                                    <option value="02">2</option>
                                                                    <option value="03">3</option>
                                                                    <option value="04" selected="selected">4</option>
                                                                    <option value="05">5</option>
                                                                    <option value="06">6</option>
                                                                    <option value="07">7</option>
                                                                    <option value="08">8</option>
                                                                    <option value="09">9</option>
                                                                    <option value="10">10</option>
                                                                    <option value="11">11</option>
                                                                    <option value="12">12</option>
                                                                    <option value="13">13</option>
                                                                    <option value="14">14</option>
                                                                    <option value="15">15</option>
                                                                    <option value="16">16</option>
                                                                    <option value="17">17</option>
                                                                    <option value="18">18</option>
                                                                    <option value="19">19</option>
                                                                    <option value="20">20</option>
                                                                    <option value="21">21</option>
                                                                    <option value="22">22</option>
                                                                    <option value="23">23</option>
                                                                    <option value="24">24</option>
                                                                    <option value="25">25</option>
                                                                    <option value="26">26</option>
                                                                    <option value="27">27</option>
                                                                    <option value="28">28</option>
                                                                    <option value="29">29</option>
                                                                    <option value="30">30</option>
                                                                    <option value="31">31</option>
                                                                </select>-<select name="data[ZingTransaction][to_date][month]" id="ZingTransactionToDateMonth">
                                                                    <option value="01">01</option>
                                                                    <option value="02">02</option>
                                                                    <option value="03">03</option>
                                                                    <option value="04">04</option>
                                                                    <option value="05">05</option>
                                                                    <option value="06">06</option>
                                                                    <option value="07">07</option>
                                                                    <option value="08">08</option>
                                                                    <option value="09">09</option>
                                                                    <option value="10" selected="selected">10</option>
                                                                    <option value="11">11</option>
                                                                    <option value="12">12</option>
                                                                </select>-<select name="data[ZingTransaction][to_date][year]" id="ZingTransactionToDateYear">
                                                                    <option value="2010">2010</option>
                                                                    <option value="2011" selected="selected">2011</option>
                                                                </select></div><input  type="submit" class="BtnTimMa JsTransactionSb" value=" " style="width:80px; height: 30px;margin:0 0 0 10px;background-image:url(DealZing_files/tim-ma.gif)" />
                                                        </li>
                                                    </ul>
                                                </li>                        				
                                            </ul>
                                        </fieldset> 
                                        <input type="hidden" id="ztartday" value="http://deal.zing.vn/zing_transactions/zstat:day_1317701373"/>
                                        <input type="hidden" id="ztartweek" value="http://deal.zing.vn/zing_transactions/zstat:week_1317701373"/>
                                        <input type="hidden" id="ztartmonth" value="http://deal.zing.vn/zing_transactions/zstat:month_1317701373"/>                      			                     			
                                        <fieldset style="display:none;">
                                            <input type="hidden" name="data[_Token][fields]" value="68f5dd09832a26d035e0f23ffebfa576b5136b94%3An%3A0%3A%7B%7D" id="TokenFields1095829064" />
                                        </fieldset>
                                    </form>
                                    <table width="100%" cellspacing="0" cellpadding="0" class="MyTable MyTableQLDH">
                                        <thead>
                                            <tr>
                                                <th>Ngày</th>
                                                <th>Thông tin chi tiết</th>
                                                <th>Nạp vào</th>
                                                <th>Chi ra</th>
                                            </tr>
                                        </thead>
                                        <tbody> 
                                            <%
                                                double tongso = 0;
                                                //DecimalFormat df = new DecimalFormat("###,###");
                                                for (int i = 0; i < lstLichSuGiaoDich.size(); i++) {
                                                    Chitietdondathang ctddh = lstLichSuGiaoDich.get(i);
                                                    Dondathang dondh = ctddh.getDondathang();
                                                    Sanpham sanpham = ctddh.getSanpham();
                                                    tongso += ctddh.getDonGiaBan();
                                            %>
                                            <tr class="OddRow">
                                                <td class="HorzCenter"><span class="c" title="<%=dondh.getNgayDat()%>"><%=dondh.getNgayDat()%></span></td>
                                                <td class="HorzLeft">Đã mua một deal mới: <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="<%=sanpham.getTieuDeSanPham()%>"><span class="c1"><%=sanpham.getTenSanPham()%></span></a></td>
                                                <td class="HorzCenter">
                                                    --</td>
                                                <td class="HorzCenter">
                                                    <span class="c cr" title=""><%=ctddh.getDonGiaBan()%></span>		                          				</td>
                                            </tr>
                                            <%}%>     

                                            <tr class="OddRowQLDH">
                                                <td colspan="2" class="HorzRight">Tổng số</td>
                                                <td class="HorzCenter"><span class="c cr" title="">0</span> đ</td>
                                                <td class="HorzCenter"><span class="c cr" title=""><%=df.format(tongso)%></span> đ</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div class="QLDHCenter">
                                        <div class="Sodutaikhoan">Số dư tài khoản</div>
                                        <div class="Numtaikhoan"><span class="c cr" title=""><%=df.format(khachHang.getSoDuTaiKhoan())%></span>đ</div>
                                    </div>					                    
                                </div>
                                <!-- End .ContentBlock -->
                            </div>
                            <!-- End .StaticMain -->
                        </div>
                        <!-- End .InnerContent -->
                    </div>
                    <!-- End .OuterContent -->
                </div>
                <!-- End #static -->
                <div class="botSubContent1"></div>
            </div>

            <!-- End #subMainContent1 -->

        </div>    
    </body>
    <%
        } catch (Exception ex) {
            System.err.print(ex);
        }
    %>
</html>